<docs>
# textarea文本框
</docs>
<template>
  <div :class="`weui-cell weui-cell_access ${valid === status.REJECTED ? 'weui-cell_warn' : ''}`"
   @click="initPicker">
    <div class="weui-cell__hd">
      <p class="weui-label">{{label}}</p>
    </div>
    <div class="weui-cell__ft text overflow">{{ value }}</div>
    <text-alert :hasInitEvent.sync="hasInitEvent" :labName='label' :labelName.sync="value"></text-alert>
  </div>
</template>
<script>
import textAlert from 'base/form/textarea/textAlert';
import { mixinValid } from 'common/mixins/mixins';

export default {
  name: 'textareaAlert',
  components: { textAlert },
  props: {
    prop: String,
    label: String,
    value: String
  },
  mixins: [mixinValid],
  data() {
    return {
      hasInitEvent: false
    };
  },
  methods: {
    initPicker() {
      this.hasInitEvent = true;
    },
    upDatelableList(val){
      this.$emit('input', val);
    }
  },
  watch: {
    value(val) {
      if (this.value) {
        this.resetValid();
        this.$emit('input', val);
      }else{
        this.validItem();
        this.$emit('input', val);
      }
    },
  }
};
</script>
<style scoped lang="scss">
@import '~common/scss/var.scss';
.weui-label {
  @include label;
}
.text {
  text-align: left;
  flex: 1 1 auto;
  height: 45px;
  line-height: 45px;
  color: #000;
  font-size: $font-size-base;
}
.searchTxt{
  width: 100%;
  p{
    font-size: $font-size-base;
  }
}
</style>
